package com.ntl.webcore.tools.dingding.config;

import cn.hutool.core.util.StrUtil;
import com.ntl.webcore.tools.spring.bean.SpringUtils;
import org.springframework.core.env.Environment;

public class DingConfig {

    private static String dingServerUrl;

    private static DingConfig dingConfig = new DingConfig();

    private DingConfig(){
    }


    public static String getDingServerUrl() {
        if(StrUtil.isEmpty(dingServerUrl)){
            // 从系统配置文件中取
            Environment environment = SpringUtils.getBean(Environment.class);
            dingServerUrl = environment.getProperty("tools.dingServerUrl");
        }
        return dingServerUrl;
    }



    private void setDingServerUrl(String dingServerUrl) {
        this.dingServerUrl = dingServerUrl;
    }




}
